package com.fastCms.business.frame.utils;


import com.fastCms.business.frame.config.ApplicationContextRegister;
import com.fastCms.business.frame.exception.BusinessException;

public class ApplicationContextUtil {

    public static <T> T getBean(String name) throws BusinessException {
        Object object = ApplicationContextRegister.getApplicationContext()
                .getBean(name);
        if (object == null) {
            throw new BusinessException("系统异常");
        }
        return (T) object;
    }

}
